package com.dayfly.tip.ao.impl;

import com.dayfly.tip.ao.BaseAO;
import com.dayfly.tip.ao.UserAO;
import com.dayfly.tip.dao.UserDAO;
import com.dayfly.tip.model.CommonResult;
import com.dayfly.tip.model.Result;
import com.dayfly.tip.model.UserDO;
/**
 * 用户ao实现类
 * @author dayfly
 *
 */
public class UserAOImpl extends BaseAO implements UserAO {
	
	private UserDAO userDAO;

	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

	@Override
	public Result getUser(String userName, String password) {
		Result result = new CommonResult(false);
		UserDO user = userDAO.getUser(userName, password);
		result.put("user", user);
		result.setSuccess(true);
		return result;
	}

	@Override
	public Result createUser(UserDO user) {
		Result result = new CommonResult(false);
		userDAO.createUser(user);
		result.put("user", user);
		result.setSuccess(true);
		return result;
	}

}
